//
//  HYPreviewHistoryManager.h
//  XPlayer
//
//  Created by liguoqing on 2023/10/6.
//

#import <Foundation/Foundation.h>
#import "HYPreviewHistoryModel.h"
#import "HYVideoViewModel.h"

NS_ASSUME_NONNULL_BEGIN

typedef void(^MineLearnHistoryBlock)(BOOL isAudio,HYVideoViewModel *viewModel);

@interface HYPreviewHistoryManager : NSObject

+ (void)showHistoryInView:(UIView *)view jump:(MineLearnHistoryBlock)block;

+ (void)updateLearnHistoy;

+ (void)hiddenLearnHistory;
// 获取所有播放记录
+ (NSArray *)fetchRecentPlayRecord;
// 播放当前记录
+ (void)playCurrentHistoryWithIndex:(NSInteger)index 
                               jump:(MineLearnHistoryBlock)block;
// 获取播放viewModel
+ (void)fetchPlayVideoViewModel:(HYPreviewHistoryModel *)model;
// 文件重命名
+ (void)modifyHistoryRecordVideoTitle:(NSString *)videoTitle 
                           videoModel:(HYHomeVideoModel *)videoModel;
// 文件夹移动
+ (void)updateHistoryRecordFolderIdentification:(NSString *)folderIdentification
                                 folderModel:(HYHomeFolderModel *)folderModel;
// 文件移动
+ (void)updateHistoryRecordFolderIdentification:(NSString *)folderIdentification 
                                  videoModel:(HYHomeVideoModel *)videoModel;
// 沙盒移动文件夹
+ (void)updateHistoryRecordFolderPath:(NSString *)folderPath
                 folderIdentification:(NSString *)folderIdentification
                        newFolderPath:(NSString *)newFolderPath;
// 沙盒移动文件
+ (void)updateHistoryRecordFolderPath:(NSString *)folderPath
                          fileName:(NSString *)fileName
                     newFolderPath:(NSString *)newFolderPath;
// 文件夹设置为私密
+ (void)setPrivateHistoryRecordWithFolderModel:(HYHomeFolderModel *)folderModel;
// 设置为私密文件
+ (void)setPrivateHistoryRecordWithVideoModel:(HYHomeVideoModel *)videoModel;
// 移除文件夹同时移除文件夹下的播放记录
+ (void)removeHistoryRecordWithFolderModel:(HYHomeFolderModel *)folderModel;
// 移除文件时同时移除播放记录(首页)
+ (void)removeHistoryRecordWithVideoModel:(HYHomeVideoModel *)videoModel;
// 移除沙盒下的文件夹
+ (void)removeDocumentHistoryRecordWithFolderPath:(NSString *)folderPath
                             folderIdentification:(NSString *)folderIdentification;
// 移除沙盒下的文件
+ (void)removeHistoryRecordWithVideoTitle:(NSString *)videoTitle 
                               createDate:(NSString *)createDate;
// 移除当前播放记录
+ (void)removeCurrentHistoyWithIndex:(NSInteger)index resultBlock:(dispatch_block_t)resultBlock;
// 清空播放记录
+ (BOOL)clearAllPlayHistory;

@end

NS_ASSUME_NONNULL_END
